package cn.iocoder.yudao.module.biz.dal.mysql.contract.expense;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;

import cn.iocoder.yudao.module.biz.dal.dataobject.contract.expense.ContractArchiveExpenseDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.contract.expense.vo.*;

/**
 * 合同档案-支出 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ContractArchiveExpenseMapper extends BaseMapperX<ContractArchiveExpenseDO> {

    default PageResult<ContractArchiveExpenseDO> selectPage(ContractArchiveExpensePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ContractArchiveExpenseDO>()
                .eqIfPresent(ContractArchiveExpenseDO::getContractArchiveId, reqVO.getContractArchiveId())
                .likeIfPresent(ContractArchiveExpenseDO::getName, reqVO.getName())
                .eqIfPresent(ContractArchiveExpenseDO::getType, reqVO.getType())
                .eqIfPresent(ContractArchiveExpenseDO::getIsPaid, reqVO.getIsPaid())
                .eqIfPresent(ContractArchiveExpenseDO::getMoney, reqVO.getMoney())
                .eqIfPresent(ContractArchiveExpenseDO::getReceiver, reqVO.getReceiver())
                .eqIfPresent(ContractArchiveExpenseDO::getContent, reqVO.getContent())
                .betweenIfPresent(ContractArchiveExpenseDO::getContentDate, reqVO.getContentDate())
                .eqIfPresent(ContractArchiveExpenseDO::getConfirmPerson, reqVO.getConfirmPerson())
                .betweenIfPresent(ContractArchiveExpenseDO::getConfirmDate, reqVO.getConfirmDate())
                .eqIfPresent(ContractArchiveExpenseDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ContractArchiveExpenseDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ContractArchiveExpenseDO::getId));
    }

}